        if (!AMap.Request) {
            AMap.Request=function(e,h){
                $.ajax({url:e,type:"GET",dataType:"jsonp",jsonp:"cbk",async:!1,cache:!1,success:function(e){h(e);},error:function(){}});
            };
        }
        AMap.Hotspot = function(mapObj, url, isDebugMode) {
            this.mapObj = mapObj;
            this._type = "hotspot";
            this.debug = isDebugMode || false;
            this.tiles = null;
            this.hotspots = {};
            this.url = url;
            this.mkr = "hotspot_" + this._getGuid();
            this.zooms = [10, 18];
            this.lastTile = this.lastId = "";
            this.markerZIndex = 99999;
            this.promptZIndex = 99998;
            this.initialize(mapObj);
        };
        AMap.Hotspot.prototype = {
            _getGuid: function() {
                return "g_" + 1E4 * Math.random();
            },
            initialize: function(mapObj) {
                this.tiles = mapObj.getTiles();
                var that = this, currentZoom = mapObj.getZoom();
                currentZoom >= that.zooms[0] && currentZoom <= that.zooms[1] && new AMap.Request(this.url + "?tiles=" + this.tiles.join(";") + "&level=" + mapObj.getZoom(), function(mapObj) {
                    that.addHotspot(mapObj);
                });
                var k = !1;
                this.onMouseMove = j = function(MapsEvent) {
                    if (!k) {
                        that.removePrompt();
                        var pixelLoc = mapObj.lnglatToPixel(MapsEvent.lnglat, mapObj.getZoom()), tile_x = Math.floor(pixelLoc.x / 256), tile_y = Math.floor(pixelLoc.y / 256), currentTile = that.hotspots[tile_x + "," + tile_y];
                        if (!currentTile)
                            return false;
                        for (var t in currentTile) {
                            var s = currentTile[t].b;
                            if (that.debug) {
                                that.addMarker(mapObj, currentTile[t]);
                            } else if (MapsEvent.lnglat.lng > s[0] && MapsEvent.lnglat.lng < s[2] && MapsEvent.lnglat.lat > s[1] && MapsEvent.lnglat.lat < s[3] && (that.lastId !== currentTile[t].id || that.lastTile !== tile_x + "," + tile_y)) {
                                if ("false" === currentTile[t].pos) {
                                    var u = that.hotspots[tile_x - 1 + "," + tile_y], s = that.hotspots[tile_x + 1 + "," + tile_y], C = that.hotspots[tile_x + "," + (tile_y - 1)], v = that.hotspots[tile_x + "," + (tile_y + 1)];
                                    u && u[t] ? currentTile[t].pos = u[t].pos : s && s[t] ? currentTile[t].pos = s[t].pos : C && C[t] ? currentTile[t].pos = C[t].pos : v && v[t] && (currentTile[t].pos = v[t].pos);
                                }
                                try {
                                    if (MapsEvent.originalEvent.target) {
                                        var target = MapsEvent.originalEvent.target; 
                                    } else {
                                        var target = window.originalEvent.srcElement;
                                    }
                                    var className = target.getAttribute("class");
                                    if (className === "hotspots") {
                                        that.addPrompt(currentTile[t], MapsEvent.lnglat);
                                    }
                                } catch(e) {
                                    console.log('error:',e);
                                    debugger;
                                }
                                
                                that.addMarker(mapObj, currentTile[t]);
                                that.lastId = t;
                                that.lastTile = tile_x + "." + tile_y;
                            }
                        }
                    }
                };
                mapObj.bind(mapObj, "mousemove", j);
                var f = function() {
                    if (!k) {
                        var f = that.getNewTiles(mapObj.getTiles()), currentZoom = mapObj.getZoom();
                        0 < f.length && (currentZoom >= that.zooms[0] && currentZoom <= that.zooms[1]) && (f = that.url + "?tiles=" + f.join(";") + "&level=" + currentZoom, new AMap.Request(f, function(mapObj) {
                            that.addHotspot(mapObj);
                        }));
                    }
                };
                mapObj.bind(mapObj, "mapmove", f);
                mapObj.bind(mapObj, "dragstart", function() {
                    k = !0;
                });
                mapObj.bind(mapObj, "dragend", function() {
                    k = !1;
                    f();
                });
                mapObj.bind(mapObj, "zoomchange", function() {
                    that.hotspots = {};
                    mapObj.removeOverlays(that.mkr);
                    f();
                });
            },
            setEnabled: function(e) {
                var h = this.mapObj;
                e ? h.bind(h, "mousemove", this.onMouseMove) : h.unbind(h, "mousemove", this.onMouseMove);
            },
            addMarker: function(e, h) {
                if (this.hasReplacement(h.ic, e)) {
                    var j = this.getReplacement(h.ic);
                    if ("" === j)
                        return;
                    h.n = j;
                }
                var j = [], k = this.debug ? "border:#F00 solid 1px;" : "";
                h.i && (j.push("<div class='hotspots' style=\"" + k + "left:" + h.i[0] + "px;top:" + h.i[1] + "px;width:" + h.i[2] + "px;height:" + h.i[3] + "px;"), AMap.Util.isIE && !AMap.Util.isIE9 && (j.push("background-color:#fff;cursor:hand;filter:alpha(opacity=1);"), 10 === document.documentMode && 
                j.push("opacity:0.01;")), j.push('position:absolute;cursor:pointer;"></div>'));
                if (h.t)
                    for (var f = 0; f < h.t.length; f++)
                        j.push("<div class='hotspots' style=\"" + k + "left:" + h.t[0] + "px;top:" + h.t[1] + "px;width:" + h.t[2] + "px;height:" + h.t[3] + "px;"), AMap.Util.isIE && !AMap.Util.isIE9 && (j.push("background-color:#fff;cursor:hand;filter:alpha(opacity=1);"), 10 === document.documentMode && j.push("opacity:0.01;")), j.push('position:absolute;cursor:pointer;"></div>');
                var n = new AMap.Marker({id: this.debug ? h.d : this.mkr,position: new AMap.LngLat(h.b[0], 
                    h.b[3]),zIndex: this.markerZIndex,content: j.join("")});
                e.addOverlays(n);
                var o = this;
                this._bind_(e, n, function() {
                    var f = h.p !== "false" ? new AMap.LngLat(h.p[0], h.p[1]) : new AMap.LngLat(h.b[0], h.b[3]);
                    e.trigger(o, "click", {position: f,name: h.n});
                    e.unbind(n, "click", this);
                });
            },
            removePrompt: function() {
                this.mapObj.removeOverlays("hotspot_prompt");
            },
            addPrompt: function(e, h) {
                e.n && this.mapObj.addOverlays(new AMap.Marker({id: "hotspot_prompt",position: h,zIndex: this.promptZIndex,content: '<div style="position: relative; background-color: #FFFEEF; border: 1px solid #7E7E7E; margin:15px 0 0 15px; padding: 3px 8px 3px 7px; font-size: 12px; white-space: nowrap; background-position: initial initial; background-repeat: initial initial;"><div style="color: #7E7E7E;">' + 
                    e.n + "</div></div>"}));
            },
            addHotspot: function(e) {
                if (!e)
                    return !1;
                for (var h in e.list)
                    this.hotspots[h] = e.list[h];
            },
            getNewTiles: function(e) {
                for (var h = [], j = [], k = this.tiles.join(","), f = 0; f < e.length; f++)
                    -1 === k.indexOf(e[f]) && (h.push(e[f]), this.tiles.push(e[f]));
                k = e.join(",");
                for (e = 0; e < this.tiles.length; e++)
                    -1 === k.indexOf(this.tiles[e]) && (j.push(this.tiles[e]), this.hotspots[this.tiles[e]] && (this.hotspots[this.tiles[e]] = null, delete this.hotspots[this.tiles[e]]), this.tiles.splice(e, 1), e--);
                return h;
            },
            events: {},_bind_: function(e, h, j) {
                e.unbind(this.events.mkr, "click", this.events.fn);
                e.bind(h, "click", j);
                this.events = {mkr: h,fn: j};
            }
        };
        (function() {
            for (var e = {}, h = "\u505c\u8f66\u573a,1569,18 \u505c\u8f66\u6362\u4e58\u70b9,1570,18 ,3223,17-18 \u5929\u5b89\u95e8,2030,11-18 ,10000,13 ,10001,13 ,10002,13 ,10003,13 ,10004,13 ,10005,13 ,10006,13 ,10007,13 ,10008,13 ,10009,13 ,10010,13 ,10011,13 ,10012,13 ,10013,13 ,10014,13 ,10015,13 ,10016,13 ,10017,13 ,10018,13 ,10019,13 \u4e2d\u56fd\u7535\u4fe1\u8425\u4e1a\u5385,1948,16 \u4e2d\u56fd\u7f51\u901a\u8425\u4e1a\u5385,1949,16 \u4e2d\u56fd\u79fb\u52a8\u8425\u4e1a\u5385,1950,16 \u4e2d\u56fd\u8054\u901a\u8425\u4e1a\u5385,1951,16 \u4e2d\u56fd\u94f6\u884c,1770,16 \u4e2d\u56fd\u5de5\u5546\u94f6\u884c,1771,16 \u4e2d\u56fd\u5efa\u8bbe\u94f6\u884c,1772,16 \u4e2d\u56fd\u519c\u4e1a\u94f6\u884c,1773,16 \u4ea4\u901a\u94f6\u884c,1774,16 \u62db\u5546\u94f6\u884c,1775,16 \u4e2d\u56fd\u90ae\u653f\u50a8\u84c4,1805,16 \u90ae\u5c40,1971,16 \u80af\u5fb7\u57fa,1689,16 \u9ea6\u5f53\u52b3,1690,16 \u52a0\u6cb9\u7ad9,1933,16-18 \u4e2d\u56fd\u77f3\u5316,1934,16-18 \u4e2d\u56fd\u77f3\u6cb9,1935,16-18 \u58f3\u724c\u52a0\u6cb9\u7ad9,1936,16-18 \u7f8e\u5b5a\u52a0\u6cb9\u7ad9,1937,16-18 \u52a0\u5fb7\u58eb\u52a0\u6cb9\u7ad9,1938,16-18 \u534e\u6da6\u52a0\u6cb9\u7ad9,1939,16-18 \u4e1c\u65b9\u52a0\u6cb9\u7ad9,1940,16-18 \u4e2d\u77f3\u6cb9\u78a7\u8f9f\u52a0\u6cb9\u7ad9,1941,16-18 \u4e2d\u77f3\u5316\u78a7\u8f9f\u52a0\u6cb9\u7ad9,1942,16-18 \u9053\u8fbe\u5c14\u52a0\u6cb9\u7ad9,1943,16-18 \u52a0\u6cb9\u52a0\u6c14\u7ad9,1944,16-18 \u52a0\u6c14\u7ad9,1945,16-18 \u57c3\u7d22\u52a0\u6cb9\u7ad9,1946,16-18 \u51fa\u53e3,1625,17-18 \u5165\u53e3,1626,17-18 \u51fa\u53e3,1395,17-18 \u5165\u53e3,1396,17-18 ATM,1815,17-18 \u4e2d\u56fd\u94f6\u884cATM,1816,17-18 \u4e2d\u56fd\u5de5\u5546\u94f6\u884cATM,1817,17-18 \u4e2d\u56fd\u5efa\u8bbe\u94f6\u884cATM,1818,17-18 \u4e2d\u56fd\u519c\u4e1a\u94f6\u884cATM,1819,17-18 \u4ea4\u901a\u94f6\u884cATM,1820,17-18 \u62db\u5546\u94f6\u884cATM,1821,17-18 \u534e\u590f\u94f6\u884cATM,1822,17-18 \u4e2d\u4fe1\u94f6\u884cATM,1823,17-18 \u4e2d\u56fd\u6c11\u751f\u94f6\u884cATM,1824,17-18 \u4e2d\u56fd\u5149\u5927\u94f6\u884cATM,1825,17-18 \u4e0a\u6d77\u94f6\u884cATM,1826,17-18 \u4e0a\u6d77\u6d66\u4e1c\u53d1\u5c55\u94f6\u884cATM,1827,17-18 \u6df1\u5733\u53d1\u5c55\u94f6\u884cATM,1828,17-18 \u6df1\u5733\u5e02\u5546\u4e1a\u94f6\u884cATM,1829,17-18 \u5174\u4e1a\u94f6\u884cATM,1830,17-18 \u5317\u4eac\u94f6\u884cATM,1831,17-18 \u5e7f\u4e1c\u53d1\u5c55\u94f6\u884cATM,1832,17-18 \u4e2d\u56fd\u4fe1\u5408ATM,1833,17-18 \u9999\u6e2f\u6052\u751f\u94f6\u884cATM,1834,17-18 \u4e1c\u4e9a\u94f6\u884cATM,1835,17-18 \u7f8e\u56fd\u82b1\u65d7\u94f6\u884cATM,1836,17-18 \u6e23\u6253\u94f6\u884cATM,1837,17-18 \u6c47\u4e30\u94f6\u884cATM,1838,17-18 \u8377\u5170\u94f6\u884cATM,1839,17-18 \u7f8e\u56fd\u8fd0\u901a\u94f6\u884cATM,1840,17-18 \u745e\u58eb\u53cb\u90a6\u94f6\u884cATM,1841,17-18 \u7f8e\u56fd\u94f6\u884cATM,1842,17-18 \u8499\u7279\u5229\u5c14\u94f6\u884cATM,1843,17-18 \u7ebd\u7ea6\u94f6\u884cATM,1844,17-18 \u82cf\u683c\u5170\u7687\u5bb6\u94f6\u884cATM,1845,17-18 \u6cd5\u56fd\u5174\u4e1a\u94f6\u884cATM,1846,17-18 \u5fb7\u610f\u5fd7\u94f6\u884cATM,1847,17-18 \u65e5\u672c\u4e09\u83f1\u4e1c\u4eac\u65e5\u8054\u94f6\u884cATM,1848,17-18 \u5df4\u514b\u83b1\u94f6\u884cATM,1849,17-18 \u6469\u6839\u5927\u901a\u94f6\u884cATM,1850,17-18 \u4e2d\u56fd\u90ae\u653f\u50a8\u84c4ATM,1851,17-18 \u9999\u6e2f\u661f\u5c55\u94f6\u884cATM,1852,17-18 \u5357\u6d0b\u5546\u4e1a\u94f6\u884cATM,1853,17-18 \u4e0a\u6d77\u5546\u4e1a\u94f6\u884cATM,1854,17-18 \u6c38\u4ea8\u94f6\u884cATM,1855,17-18 \u9999\u6e2f\u6c38\u9686\u94f6\u884cATM,1856,17-18 \u521b\u5174\u94f6\u884cATM,1857,17-18 \u5927\u65b0\u94f6\u884cATM,1858,17-18 \u4e2d\u4fe1\u5609\u534e\u94f6\u884cATM,1859,17-18 \u5927\u4f17\u94f6\u884cATM,1860,17-18 \u516c\u5171\u5395\u6240,1982,17-18 \u505c\u8f66\u573a,1571,17-18 \u505c\u8f66\u573a,1572,17-18 \u505c\u8f66\u573a,1573,17-18 \u505c\u8f66\u573a,1979,17-18 \u505c\u8f66\u573a,1980,17-18 \u516c\u4ea4\u8f66\u7ad9,1565,18".split(" "), j = 0; j < h.length; j++) {
                var k = h[j];
                k && (k = k.split(","), 3 === k.length && (e[k[1]] = {name: k[0],levels: k[2].split("-")}));
            }
            AMap.Hotspot.prototype.hasReplacement = function(f, h) {
                if ("undefined" === typeof e[f])
                    return !1;
                var j = h.getZoom(), k = e[f].levels;
                return 1 === k.length ? k[0] === j : 2 === k.length ? k[0] <= j && k[1] >= j : !1;
            };
            AMap.Hotspot.prototype.getReplacement = function(f) {
                return e[f].name;
            };
        })();
        AMap.MassHotspot = function(e, h) {
            this._tileLayerUrl = "http://vector.amap.com/mass/raster";
            this._dataUrl = "http://vector.amap.com/mass";
            this._type = 
            "masshotspot";
            this.tiles = !1;
            this.hotspots = {};
            this.mkr = "hots" + this._getGuid();
            this.zooms = [8, 18];
            this.lastTile = this.lastId = "";
            this.ie678 = /msie [6|7|8].0/.test(navigator.userAgent.toLowerCase());
            this.map = e;
            this.keyword = h;
            this.initialize(e, h);
        };
        AMap.MassHotspot.prototype = {
            _getGuid: function() {
                return "g_" + 1E4 * Math.random();
            },destroy: function() {
                this.map.unbind(this.map, "mousemove", this.onMouseMove);
                this.map.unbind(this.map, "dragstart", this.onDragStart);
                this.map.unbind(this.map, "dragend", this.onDragEnd);
                this.map.unbind(this.map, 
                "zoomchange", this.onZoomChange);
                this.map.removeLayer(this.hotspotLayer.id);
                this.map.removeOverlays(this.mkr);
                this.removePrompt();
                this.hotspots = {};
            },
            requestData: function(e) {
                var h = this, j = function(e) {
                    logx("completed loading data...");
                    h.addHotspot(e);
                }, j = AF.groupCallback(j, "MassHotspot");
                logx("loading data...");
                $.ajax({url: this._dataUrl + "?tiles=" + e.join(";") + "&level=" + this.map.getZoom() + "&keywords=" + encodeURIComponent(this.keyword),type: "GET",dataType: "jsonp",jsonp: "cbk",async: !0,cache: !1,timeout: 6E4,success: function(e) {
                        j(e);
                    },
                    error: function(e) {
                        logx("error loading data...");
                        logx(arguments);
                    }});
            },
            initialize: function(e, h) {
                var j = this, k = encodeURIComponent(h);
                this.hotspotLayer = new AMap.TileLayer({zIndex: 30,zooms: this.zooms,getTileUrl: function(e, f, h) {
                        return j._tileLayerUrl + "?tile=" + e + "," + f + "&level=" + h + "&keywords=" + k;
                    }});
                e.addLayer(this.hotspotLayer);
                this.tiles = e.getTiles();
                var f = e.getZoom();
                f >= j.zooms[0] && f <= j.zooms[1] && j.requestData(this.tiles);
                var n = !1, f = this.onMouseMove = function(f) {
                    if (!n) {
                        j.removePrompt();
                        var h = e.lnglatToPixel(f.lnglat, 
                        e.getZoom()), k = Math.floor(h.x / 256), o = Math.floor(h.y / 256), p = j.hotspots[k + "," + o];
                        if (!p)
                            return logx(k + "," + o + ": N/A"), !1;
                        for (var u in p) {
                            var v = p[u].position, A = Math.floor(h.x - 256 * k), w = Math.floor(h.y - 256 * o);
                            if (12.25 > Math.pow(A - v[0], 2) + Math.pow(w - v[1], 2)) {
                                h = new AMap.Pixel(256 * k + v[0], 256 * o + v[1]);
                                h = e.pixelToLngLat(h, e.getZoom());
                                k = j.getNearby(h, p[u], k, o);
                                o = _.first(_.pluck(k, "name"), 5);
                                5 < k.length && o.push("......");
                                j.addPrompt(h, o.join("<br />"));
                                j.addMarker(h, p[u].name, p[u].id, f.lnglat, _.pluck(k, "id"));
                                break
                            } else
                                100 > 
                                Math.pow(A - v[0], 2) + Math.pow(w - v[1], 2) && e.removeOverlays(j.mkr);
                        }
                    }
                };
                e.bind(e, "mousemove", f);
                this.onDragStart = function() {
                    n = !0;
                };
                var o = function() {
                    var f = j.getNewTiles(e.getTiles()), h = e.getZoom();
                    0 < f.length && (h >= j.zooms[0] && h <= j.zooms[1]) && j.requestData(f);
                };
                this.onDragEnd = function() {
                    n = !1;
                    o();
                };
                this.onZoomChange = function() {
                    j.hotspots = {};
                    e.removeOverlays(j.mkr);
                    o();
                };
                e.bind(e, "dragstart", this.onDragStart);
                e.bind(e, "dragend", this.onDragEnd);
                e.bind(e, "zoomchange", this.onZoomChange);
            },
            addHotspot: function(e) {
                if (!e || 
                !e.list)
                    return !1;
                for (var h = 0; h < e.list.length; h++) {
                    var j = e.list[h], k = j.index;
                    this.hotspots[k.x + "," + k.y] = j.tile;
                }
            },
            getNewTiles: function(e) {
                for (var h = [], j = [], k = this.tiles.join(","), f = 0; f < e.length; f++)
                    -1 === k.indexOf(e[f]) && (h.push(e[f]), this.tiles.push(e[f]));
                k = e.join(",");
                for (e = 0; e < this.tiles.length; e++)
                    -1 === k.indexOf(this.tiles[e]) && (j.push(this.tiles[e]), this.hotspots[this.tiles[e]] && (this.hotspots[this.tiles[e]] = null, delete this.hotspots[this.tiles[e]]), this.tiles.splice(e, 1), e--);
                return h;
            },
            removePrompt: function() {
                this.map.removeOverlays("masshotspot_prompt");
            },
            getNearby: function(e, h, j, k) {
                var f = this, n = [], o = h.position[0], p = h.position[1], r = 256 * j + o, t = 256 * k + p, h = function(e, h) {
                    var j = e + "," + h;
                    if (j in f.hotspots)
                        for (var j = f.hotspots[j], k = 0; k < j.length; k++) {
                            var o = j[k], a = 256 * h + o.position[1];
                            o.weight = Math.pow(256 * e + o.position[0] - r, 2) + Math.pow(a - t, 2);
                            100 > o.weight && n.push(o);
                        }
                }, e = [-1, 0, 1], o = [o - 10, 0, o + 10 - 256], p = [p - 10, 0, p + 10 - 256], s = 0;
                for (; s < o.length; s++)
                    if (!(0 > o[s] * e[s]))
                        for (var u = 0; u < p.length; u++)
                            0 > p[u] * e[u] || h(j + e[s], k + e[u]);
                return n = _.sortBy(n, function(e) {
                    return e.weight;
                });
            },
            addPrompt: function(e, h) {
                h && this.map.addOverlays(new AMap.Marker({id: "masshotspot_prompt",position: e,zIndex: 9999,content: '<div style="position: relative; background-color: #FFFEEF; border: 1px solid #7E7E7E; margin:15px 0 0 15px; padding: 3px 8px 3px 7px; font-size: 12px; white-space: nowrap; background-position: initial initial; background-repeat: initial initial;"><div style="color: #7E7E7E;">' + h + "</div></div>"}));
            },
            addMarker: function(e, h, j, k, f) {
                var n = this, o = document.createElement("div");
                o.style.cursor = 
                "pointer";
                o.style.background = "url(/images/poi.png) no-repeat -380px 0px";
                o.style.width = "30px";
                o.style.height = "30px";
                o.style.position = "absolute";
                o.style.top = "0px";
                o.style.left = "0px";
                k = new AMap.Marker({id: this.mkr,position: new AMap.LngLat(k.lng, k.lat),content: o,offset: {x: -18,y: -18}});
                o = this.map;
                o.bind(k, "click", function() {
                    logx("click marker: " + h);
                    n.map.trigger(n, "click", {position: e,name: h,id: j,nearbyIds: f});
                });
                o.removeOverlays(n.mkr);
                o.addOverlays(k);
            }
        };
